package isnmp.ui.dto;



import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import sg.simple.snmp.stats.TableData;

public class DeviceInfo extends TableData {

	Map<String, Object> values = new HashMap<String, Object>();

	public enum DEVICE_PROPERTY {

		INDEX("Index"), DESCRIPTION("Description"), ID("Device Id"), STATUS(
				"Status"), ERRORS("Number of Errors");

		String displayName;

		private DEVICE_PROPERTY(String n) {
			this.displayName = n;
		}

		public String getDisplayName() {
			return displayName;
		}

		@Override
		public String toString() {
			return this.displayName;
		}
	}

	public void putValue(DEVICE_PROPERTY code, Object value) {
		values.put(code.getDisplayName(), value);
	}

	@Override
	public int getCellCount() {
		return values.size();
	}

	
	@Override
	public  String getPropertyName(int columnIndex) {
		
             DEVICE_PROPERTY[] enumValues = DEVICE_PROPERTY.values();
             return enumValues[columnIndex].getDisplayName();
	}

	@Override
	public Object getValue(String key) {
		return values.get(key);
	}

	@Override
        public Object getCellData(int columnIndex) {
            
          DEVICE_PROPERTY[] enumValues = DEVICE_PROPERTY.values();
          
          return getValue(enumValues[columnIndex].getDisplayName());            
        }

        
	@Override
	public String toString() {
		return "DeviceInfo [values=" + values + "]";
	}
	
}
	